package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    /**
     * 批量插入订单明细表
     *
     * @param orderDetails
     */
    void insertBatch(List<OrderDetail> orderDetails);

//    /**
//     * 获取详情订单
//     * @param orderId
//     * @return
//     */
//    List<OrderDetail> getDetails(Long orderId);


    OrderDetail get(Long orderId);

    /**
     * 根据订单id查询订单明细
     *
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /**
     * 根据id获取详情
     *
     * @param orderId
     * @return
     */
    @Select("select  * from  order_detail where order_id  = #{orderId}")
    List<OrderDetail> getDetails(Long orderId);

    /**
     * 再来一单
     *
     * @param orderDetails
     */
    void oneMoreOrder(List<OrderDetail> orderDetails);


    @Select("select * from order_detail where  order_id = #{orderId}")
    List<OrderDetail> enquiryDetails(Long id);
}

